package com.example.intentwithobjecttransfer;

import android.os.Parcel;
import android.os.Parcelable;

public class Login implements Parcelable
{
	private String Username;
	private  String Password;
	
	public Login(Parcel source) 
	{
		String data[] = new String[2];
		
		source.readStringArray(data);
		
		Username = data[0];
		Password = data[1];
	}
	
	public Login(String user, String pass)
	{
		Username = user;
		Password = pass;
	}
	public String getUsername()
	{
		return Username;
	}
	
	public String getPassword()
	{
		return Password;
	}

	
	@Override
	public int describeContents() {return 0;}

	@Override
	public void writeToParcel(Parcel out, int flags) 
	{
		out.writeStringArray(new String[]{this.Username, this.Password});
	}
	
	public static Parcelable.Creator<Login> CREATOR = new Parcelable.Creator<Login>() 
	{

		@Override
		public Login createFromParcel(Parcel source) 
		{
			return new Login(source);
		}

		@Override
		public Login[] newArray(int size) 
		{
			return new Login[size];
		}
		
	};
}
